package main.java.Fzy.Demo;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        System.out.println(main.test('f'));
    }

    public int test(char b){

        Scanner sc = new Scanner(System.in);

        String text = sc.next();
        int sum = 0;
        int n = text.length();

        for(int i = 0;i<n;i++){
            for(int j = i;j<n;j++){
                String newTest = text.substring(i,(j+1));
                if(contain(newTest,b)){
                    sum++;
                }
            }
        }
        return sum;
    }
    public boolean contain(String test,char b){
        char[] arr = test.toCharArray();

        for(int i = 0;i<arr.length;i++){
            if(arr[i] == b){
                return true;
            }
        }
        return false;
    }


}
